import Vue from 'vue'
import Vuex from 'vuex'
import axios from 'axios'

Vue.use(Vuex)

//对外暴露store的一个实例
export default new Vuex.Store({
    state:{sum:''},
    mutations:{},
    actions:{
      test(){
        let urlHost = process.env.API_HOST 
        alert(urlHost)
        var url=urlHost+"api/product/getBaseCategoryList"
          axios.get(url).then(res=>{
              console.log(res)
              this.state.sum=res;
          }).catch(err=>{
              console.log(err)
          })
      }

    },
    
 })
